home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s1.arc
/
GETFSIZE.MOD
< prev
next >
Wrap
Text File
|
1986-06-17
|
3KB
|
65 lines
(*----------------------------------------------------------------------*)
(* Get_File_Size --- Get size in bytes for a file *)
(*----------------------------------------------------------------------*)
FUNCTION Get_File_Size( Fname: AnyStr; VAR OpenOK : BOOLEAN ): REAL;
(*----------------------------------------------------------------------*)
(* *)
(* Procedure: Get_File_Size *)
(* *)
(* Purpose: Get size in bytes for a file *)
(* *)
(* Calling Sequence: *)
(* *)
(* Fsize := Get_File_Size( Fname : AnyStr; *)
(* VAR OpenOK : BOOLEAN ) : REAL; *)
(* *)
(* Fname --- name of file to find size of *)
(* OpenOK --- set TRUE if file opened successfully *)
(* Fsize --- file size in bytes *)
(* *)
(* Calls: *)
(* *)
(* RESET *)
(* Int24Result *)
(* ASSIGN *)
(* LongFileSize *)
(* Close *)
(* *)
(* Remarks: *)
(* *)
(* The file must not already be opened before calling this *)
(* routine. *)
(* *)
(*----------------------------------------------------------------------*)
VAR
F : FILE OF BYTE;
I : INTEGER;
BEGIN (* Get_File_Size *)
Get_File_Size := 0.0;
ASSIGN( F , Fname );
(*$I- *)
RESET ( F );
(*$I+ *)
IF Int24Result = 0 THEN
BEGIN
Get_File_Size := LongFileSize( F );
OpenOK := TRUE;
END
ELSE
OpenOK := FALSE;
(*$I-*)
CLOSE( F );
(*$I+*)
I := INT24Result;
END (* Get_File_Size *);